package com.vancouver.knows.ui.fragment.my;

import android.content.Context;
import android.view.View;

import com.pangu.task.mark.ATaskMark;
import com.pangu.ui.refresh.ARefreshViewController;
import com.pangu.ui.refresh.RefreshControllerView;
import com.vancouver.knows.MainApplication;
import com.vancouver.knows.business.BusinessModule;

/**
 * Created by Chris Li on 2016-08-24.
 */
public class UserImageGalleryPullRefreshView extends RefreshControllerView {

    public UserImageGalleryPullRefreshView(Context context) {
        super(context);
    }

    @Override
    protected View createContentView() {
        return new UserImageGalleryRecyclerView(getContext(), this);
    }

    @Override
    public void onRefresh(ARefreshViewController controller) {
        ((UserImageGalleryRecyclerView) content).handleRefreshLoadItem();
    }

    public void loadData() {
        BusinessModule module = ((MainApplication) imContext).getBusinessModule();
        ATaskMark aTaskMark = module.getTaskMarkPool().getFetchUserBusinessImagesTaskMark();
        ((UserImageGalleryRecyclerView) content).initLoadableView(aTaskMark);
    }
}
